package cjq.demo.thread.ch6_7;

import java.util.concurrent.ThreadLocalRandom;

/**
 * Created by Administrator on 2016/5/6.
 */
public class TaskLocalRandom implements Runnable {

    public TaskLocalRandom(){
        ThreadLocalRandom.current();
    }
    public void run(){
        String name = Thread.currentThread().getName();
        for (int i = 0; i < 10; i++) {
            System.out.println(""+name+" : "+ThreadLocalRandom.current().nextInt(10));
        }
    }
}
